﻿using FFIV.Lib.Controlers.Admin;
using FFIV.Lib.Utilities;
using FFIV.Lib.WebExtension;

public partial class Admin_EditArticle : FFWebPageBase
{
	private EditArticleController m_Controller;

	protected override void InitialFileds()
	{
		m_Controller = new EditArticleController(uc_EditAtricle);
	}

	protected override void BindingEvents()
	{
		uc_EditAtricle.UpdateArticle += uc_EditAtricle_UpdateArticle;
		uc_EditAtricle.AddDraft += uc_EditAtricle_AddDraft;
	}

	public override void ShowMessage()
	{
		if (!IsPostBack)
		{
			m_Controller.LoadPage(); 
		}
	}

	public override Permissions RequiredPermission
	{
		get { return Permissions.Author; }
	}

	private void uc_EditAtricle_UpdateArticle(object sender, System.EventArgs e)
	{
		m_Controller.UpdateArticle();
	}

	private void uc_EditAtricle_AddDraft(object sender, System.EventArgs e)
	{
		m_Controller.AddDraft();
	}
}
